#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 110, M = 2.5e5 + 10;
int a[N];
bool f[M];
int n;
void solve()
{
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    sort(a + 1, a + 1 + n);
    memset(f, 0, sizeof f);
    f[0] = true;
    // zdl:: 接下来就是多重背包的逻辑
    int ret = 0;
    for (int i = 1; i <= n; i++)
    {
        if (!f[a[i]]) ret++;
        for (int j = a[i]; j <= a[n]; j++)
        {
            f[j] = f[j] || f[j - a[i]];
        }
    }

    cout << ret << endl;
}   
int main()
{
    int t;
    cin >>  t;
    while (t--)
    {   
        solve();
    }
    return 0;
}